<?php

/**
 * This is the model class for table "kematianbayi".
 *
 * The followings are the available columns in table 'kematianbayi':
 * @property integer $kmb_id
 * @property integer $kmb_kec
 * @property integer $kmb_lahirmati
 * @property integer $kmb_asfiksia
 * @property integer $kmb_tn
 * @property integer $kmb_aspirasi
 * @property integer $kmb_bblr
 * @property integer $kmb_ispapneumonia
 * @property integer $kmb_lain
 * @property integer $kmb_jumlah
 * @property integer $kmb_tahun
 */
class Kematianbayi extends CActiveRecord
{
	/**
	 * Returns the static model of the specified AR class.
	 * @return Kematianbayi the static model class
	 */
	public static function model($className=__CLASS__)
	{
		return parent::model($className);
	}

	/**
	 * @return string the associated database table name
	 */
	public function tableName()
	{
		return 'kematianbayi';
	}

	/**
	 * @return array validation rules for model attributes.
	 */
	public function rules()
	{
		// NOTE: you should only define rules for those attributes that
		// will receive user inputs.
		return array(
			array('kmb_kec, kmb_lahirmati, kmb_asfiksia, kmb_tn, kmb_aspirasi, kmb_bblr, kmb_ispapneumonia, kmb_lain, kmb_jumlah, kmb_tahun', 'numerical', 'integerOnly'=>true),
			// The following rule is used by search().
			// Please remove those attributes that should not be searched.
			array('kmb_id, kmb_kec, kmb_lahirmati, kmb_asfiksia, kmb_tn, kmb_aspirasi, kmb_bblr, kmb_ispapneumonia, kmb_lain, kmb_jumlah, kmb_tahun', 'safe', 'on'=>'search'),
		);
	}

	/**
	 * @return array relational rules.
	 */
	public function relations()
	{
		// NOTE: you may need to adjust the relation name and the related
		// class name for the relations automatically generated below.
		return array(
		);
	}

	/**
	 * @return array customized attribute labels (name=>label)
	 */
	public function attributeLabels()
	{
		return array(
			'kmb_id' => 'Kmb',
			'kmb_kec' => 'Kmb Kec',
			'kmb_lahirmati' => 'Kmb Lahirmati',
			'kmb_asfiksia' => 'Kmb Asfiksia',
			'kmb_tn' => 'Kmb Tn',
			'kmb_aspirasi' => 'Kmb Aspirasi',
			'kmb_bblr' => 'Kmb Bblr',
			'kmb_ispapneumonia' => 'Kmb Ispapneumonia',
			'kmb_lain' => 'Kmb Lain',
			'kmb_jumlah' => 'Kmb Jumlah',
			'kmb_tahun' => 'Kmb Tahun',
		);
	}

	/**
	 * Retrieves a list of models based on the current search/filter conditions.
	 * @return CActiveDataProvider the data provider that can return the models based on the search/filter conditions.
	 */
	public function search()
	{
		// Warning: Please modify the following code to remove attributes that
		// should not be searched.

		$criteria=new CDbCriteria;

		$criteria->compare('kmb_id',$this->kmb_id);
		$criteria->compare('kmb_kec',$this->kmb_kec);
		$criteria->compare('kmb_lahirmati',$this->kmb_lahirmati);
		$criteria->compare('kmb_asfiksia',$this->kmb_asfiksia);
		$criteria->compare('kmb_tn',$this->kmb_tn);
		$criteria->compare('kmb_aspirasi',$this->kmb_aspirasi);
		$criteria->compare('kmb_bblr',$this->kmb_bblr);
		$criteria->compare('kmb_ispapneumonia',$this->kmb_ispapneumonia);
		$criteria->compare('kmb_lain',$this->kmb_lain);
		$criteria->compare('kmb_jumlah',$this->kmb_jumlah);
		$criteria->compare('kmb_tahun',$this->kmb_tahun);

		return new CActiveDataProvider($this, array(
			'criteria'=>$criteria,
		));
	}
}